# a range generator that handles floating point values
# tested with Python25 and Python31   by  vegaseat

def frange(start, stop=20, step=1.0, delta=0.001):
    # allow for decrement
    if step <= 0:
        while start > (stop + delta):
            yield start
            start += step
    else:
        while start < (stop - delta):
            yield start
            start += step

#__________________________________________________
inhalt = 0.0000            
zufluss = 10.0000          
abfluss = 0.5 * inhalt     
for x in frange(0,5,0.5):
    print x
    abfluss=0.5*inhalt
    inhalt=inhalt+zufluss-abfluss
    print "Zeit: ",x+1,"     Inhalt: ",inhalt
    
print("-"*20)
#print(list(frange(0, step=0.5)))

